<template>
	<view class="indexs">
		<view class="header header_lan" :style="'padding-top: ' + navH + 'px;'">
			<view class="header_height" :style="'height:' + gaodu + 'px;line-height:' + gaodu + 'px;top:' + gaodutops + 'px;'">
				<view class="index_h_cont3">
					<view class="index_wenben_img" @tap="jumpzuo"><image :src="imgUrl + '/dzx_img22.png'" mode="widthFix"></image></view>
					<view class="index_wenben baise">{{ $t('page_my_sms.station_message') }}</view>
				</view>
			</view>
			<view class="coloe_title">s</view>
		</view>
		<view class="index_center" :style="'padding-top:' + (navH + 50) + 'px;'">
			<view class="my_zhanghu_center">
				<view class="index_swiper">
					<view class="my_zhanghu_center_list" v-if="arrlist.length != 0">
						<view class="my_zhanghu_center_cont" v-for="(item, index1) in arrlist" :key="index1">
							<view class="my_zhanghu_center_cont_l">
								<view class="my_zhanghu_center_cont_t1">{{ $t('page_my_sms.content') }}：{{ item.content }}</view>
							</view>
							<view class="my_zhanghu_center_cont_t2">{{ item.created_time }}</view>
						</view>
					</view>

					<view class="my_zhanghu_center_kong" v-else>
						<image :src="imgUrl + '/dzx_img134.png'"></image>
						<text>{{ $t('page_my_sms.currently_no_bill') }}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
// pages/shouye/shouye_zkc/shouye_zkc.js
const app = getApp();

let request = require('../../../utils/require');

export default {
	data() {
		return {
			navH: app.globalData.navHeight,
			gaodu: app.globalData.height,
			gaodutops: app.globalData.top,
			imgUrl: app.globalData.imgUrl,
			height: 0,
			heights: 0,
			currentIndex: 0,
			left: 16,
			false: false,
			width: 0,
			//分页
			page: 1,
			ispage: true,
			arrlist: [],
			type: 0
		};
	},
	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad() {
		var that = this;
		that.zhanghulist(that.type);
	},
	onShow() {
		var that = this;
	},
	/**
	 * 生命周期函数--监听页面初次渲染完成
	 */
	onReady: function() {},
	/**
	 * 生命周期函数--监听页面隐藏
	 */
	onHide: function() {},
	/**
	 * 生命周期函数--监听页面卸载
	 */
	onUnload: function() {},
	/**
	 * 页面相关事件处理函数--监听用户下拉动作
	 */
	onPullDownRefresh: function() {},
	/**
	 * 页面上拉触底事件的处理函数
	 */
	onReachBottom: function() {
		if (this.ispage) {
			this.page= this.page + 1
			this.zhanghulist(this.type);
		}
	},
	/**
	 * 用户点击右上角分享
	 */
	onShareAppMessage: function() {},
	methods: {
		jumpzuo() {
			uni.navigateBack();
		},

		//我的余额
		zhanghulist(e) {
			var that = this;
			var data = {
				token: uni.getStorageSync('token'),
				page: that.page
			};
			request.post(`index.php?s=/api/user/smslist&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					if (that.page > res.data.data.last_page) {
						that.ispage= false
					} else {
						that.arrlist= that.arrlist.concat(res.data.data.data.data)
						console.log(res.data.data.data, 'res.data.data.list.data?');
					}
				}
			});
		}
	}
};
</script>
<style>
@import './my_sms.css';
</style>
